import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TExpDrugConfig } from "../../../Message/Db/Tables/TExpDrugConfig";
type int = number;
//class DrugExgByLvConfig
    
    export  class DrugExgByLvConfig
    {
        constructor()
        {
            
            this._mapDrugExp = new Map<any, any> /* flash.utils.Dictionary */();
            if (DrugExgByLvConfig._instance != null) 
            {
                throw new Error(" DrugExgByLvConfig 单例 ");
            }
            this.init();
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_exp_drug_config.json");
            this.writeUpdate(loc1);
            return;
        }

        /* internal  */writeUpdate(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TExpDrugConfig();
                loc1.code = loc2.code;
                loc1.level = loc2.level;
                loc1.exp = loc2.exp;
                this._mapDrugExp[loc1.code + "_" + loc1.level] = loc1;
            }
            return;
        }

        public getInfoByCode(arg1: int, arg2: int): TExpDrugConfig
        {
            var loc1=arg1 + "_" + arg2;
            return this._mapDrugExp[loc1];
        }

        public static get instance(): DrugExgByLvConfig
        {
            if (DrugExgByLvConfig._instance == null) 
            {
                DrugExgByLvConfig._instance = new DrugExgByLvConfig();
            }
            return DrugExgByLvConfig._instance;
        }

        /* internal */ /* var */_mapDrugExp: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: DrugExgByLvConfig;
    }
